package com.example.speeddating.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.speeddating.entity.Feedback;
import com.example.speeddating.mapper.FeedbackMapper;
import com.example.speeddating.service.FeedbackService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *
 * @author tina
 * @since 2023-06-28 11:14:33
 */
@Service
public class FeedbackServiceImpl extends ServiceImpl<FeedbackMapper, Feedback> implements FeedbackService {

    @Autowired
    private FeedbackMapper feedbackMapper;

    @Override
    public Page<Feedback> feedBackList(Integer pageNum, Integer pageSize) {
        Page<Feedback> page = new Page<>(pageNum,pageSize);
        return feedbackMapper.selectFeedBackList(page);
    }

    @Override
    public void handleFeedback(Long id) {
        Feedback feedback = new Feedback();
        feedback.setId(id);
        feedback.setHandle(1);
        feedbackMapper.updateById(feedback);
    }

    @Override
    public void deleteFeedback(Long id) {
        feedbackMapper.deleteById(id);
    }
}
